# Maintainer: Fabian Bornschein <fabiscafe-at-mailbox-dot-org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=gnome-settings-daemon
pkgver=45.0
pkgrel=1
pkgdesc="GNOME Settings Daemon"
url="https://gitlab.gnome.org/GNOME/gnome-settings-daemon"
arch=(loong64 x86_64)
license=(GPL)
depends=(
  dconf
  gcr-4
  geoclue
  geocode-glib-2
  gnome-desktop
  gsettings-desktop-schemas
  gtk3
  libcanberra-pulse
  libgudev
  libgweather-4
  libnm
  libnotify
  librsvg
  libwacom
  nss
  pulseaudio
  pulseaudio-alsa
  systemd
  upower
)
makedepends=(
  docbook-xsl
  git
  libxslt
  meson
  python
  usbguard
)
checkdepends=(
  python-dbusmock
  python-gobject
)
optdepends=('usbguard: USB protection support')
groups=(gnome)
backup=(etc/xdg/Xwayland-session.d/00-xrdb)
_commit=ed2173a812a820d3e7aaa8107e554f9e6068684f  # tags/45.0^0
source=(
  "git+https://gitlab.gnome.org/GNOME/gnome-settings-daemon.git#commit=$_commit"
  "git+https://gitlab.gnome.org/GNOME/libgnome-volume-control.git"
)
b2sums=('SKIP'
        'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git submodule set-url subprojects/gvc "$srcdir/libgnome-volume-control"
  git -c protocol.file.allow=always submodule update
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
